import { request } from '@/apis';
import { addPrefix } from '@/utils/helper';

const prefixUrl = '/ep-query';

const Api = {
  getOperatingPermit: '/getOperatingPermit',
  getProfessionalContracting: '/getProfessionalContracting',
  contractingLv: '/screen/contractingLv',
  getRadiationPermit: '/getRadiationPermit'
};

addPrefix(Api, prefixUrl);

export interface IBasePrams {
  cityCode?: string;
  countryCode?: string;
  provinceCode?: string;
  industryCategoryCodeLv1?: string;
  industryCategoryCodeLv2?: string;
  industryCategoryCodeLv3?: string;
  tagTypeCode?: string;
  pageNum?: number;
  pageSize?: number;
  searchTxt?: string;
  sortRule?: string;
}

export interface HazardousWastes extends IBasePrams {
  noticeEndDate?: string;
  noticeStartDate?: string;
  periodOfValidityExpirationDateEnd?: string;
  periodOfValidityExpirationDateStart?: string;
}
/** 危险废物经营许可 */
export const getOperatingPermit = (params: HazardousWastes) => request.get({ url: Api.getOperatingPermit, params });

export interface ProtectionProject extends IBasePrams {
  periodOfValidityExpirationDateEnd?: string;
  periodOfValidityExpirationDateStart?: string;
  /** 资质类别，多选逗号分隔 */
  contractingLv?: string;
}
/** 环保工程专业承包 */
export const getProfessionalContracting = (params: ProtectionProject) => request.get({ url: Api.getProfessionalContracting, params });
/** 资质类别筛选 */
export const getContractingLv = ()=>request.get({ url:Api.contractingLv });

export interface RadiationPermit extends IBasePrams, HazardousWastes {}
/** 辐射安全许可 */
export const getRadiationPermit = (params: RadiationPermit) => request.get({ url: Api.getRadiationPermit, params });
